<template>
  <div class="org-evaluation-users">
    <template v-if="list.length">
      <vxe-table
        border
        stripe
        height="100%"
        row-id="id"
        size="medium"
        resizable
        :scroll-y="{ enabled: false }"
        :data="list"
        :header-cell-class-name="headerStyle"
        :row-class-name="rowClass"
        highlight-hover-row>
        <vxe-column type="seq" title="序号" width="60" align="center"></vxe-column>
        <vxe-column field="userType" title="人员身份" align="center" min-width="150">
          <template #default="{ row }">
            <span>{{ row.userIdentity | Identity }}</span>
          </template>
        </vxe-column>
        <vxe-column field="userName" title="姓名" align="center" min-width="150"></vxe-column>
      </vxe-table>
    </template>
    <Empty v-else style="height: auto">
      <slot>暂无数据</slot>
    </Empty>
  </div>
</template>
<script>
export default {
  name: 'OrgEvaluationUsers',
  props: {
    list: {
      type: Array,
      default: () => [],
    },
  },
  filters: {
    Identity(val) {
      switch (val) {
        case '1002-01':
          return '公务员'
        case '1002-02':
          return '事业人员'
        case '1002-03':
          return '聘用人员'
        default:
          break
      }
    },
  },
  methods: {
    /* 头部样式 */
    headerStyle({ row, column, rowIndex, columnIndex }) {
      return 'headerStyle'
    },
    rowClass({ row, rowIndex }) {
      return 'rowClass'
    },
  },
}
</script>
<style lang="scss" scoped>
.org-evaluation-users {
  font-size: 14px;
  height: calc(100% - 160px);
}
/deep/.headerStyle {
  color: #333;
  border-left: 1px solid #eee;

  th,
  div,
  span,
  p {
    font-size: 14px;
  }
}

/deep/.rowClass {
  td,
  div,
  span,
  p {
    font-size: 14px;
  }
}
/deep/.empty .img {
  margin-top: 0;
}
</style>
